<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
 * Hockey extension for Joomleague
 * @version $Id: show_player.tpl.php 73 2008-01-19 22:57:01Z julien.vonthron $
 * @package JlgHockeyExtension
 * @copyright Copyright (C) 2007 Julien Vonthron. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * JlgHockeyExtension is free software and parts of it may contain or be derived from the
 * GNU General Public License or other free or open source software licenses.
 * 
 * contact: julien.vonthron[at]gmail.com 
 *   
 * Joomleague is a League Management and Prediction Game for Joomla!
 * Homepage: http://www.joomleague.de 
 *  
 */

?>

<a name="jl_top" id="jl_top"></a>
<!-- Header with Project Name-->
<?php 
if ( $showPlan_config['show_project_heading'] == "1" 
  OR $overall_config['show_project_heading'] == "1" ) 
{ 
	?>
	<div class="componentheading" <?php 
	if ( $showPlan_config['show_print_button'] == "1" 
	  OR $overall_config['show_print_button'] == "1" ) 
	{
	    echo 'style="float:left;"';
  }
  ?>>
  <?php 
  echo HTML_joomleague::showTitle($joomleague, $overall_config['project_heading_type']); 
  ?>
  </div>
	<!-- Druckfunktion -->
	<?php 
	if ( $showPlan_config['show_print_button'] == "1" 
    OR $overall_config['show_print_button'] == "1" ) 
  {
    HTML_joomleague::PrintIcon( $row, $params, false, '' );
	}
	?>
	<!-- Druckfunktion Ende -->
	<?php 
} 
?>
<!-- Header END -->

<?php 
if ($showPlan_config['show_section_heading']==1) 
{ 
	?>
	<table width="100%" class="contentpaneopen">
		<tr>
			<td class="contentheading"><?php echo _JL_RESULTS; ?> <?php
			if (isset($division)) echo $division->name.' ';
			if ( $team_plan ) echo $teams[$team_plan]->name; ?></td>
		</tr>
	</table>
	<?php 
} 
?>

<br />
<?php
	if ( isset( $overall_config['results_below'] ) 
	  && $overall_config['results_below'] == 1 ) {
	  $showPlan_config['results_below'] = 1;
  }
	
  HTML_joomleague::resultsColspan( $showPlan_config );
	
  $whatday=0;
	//print_r($rounds);
	
  foreach ( $rounds AS $round ) 
	{
	  //echo $round->id."<br/>";
		$matches = $joomleague->getResultsRows( $round->matchcode, $divisionid, $showPlan_config, $tid ); 
		?>
		
		<table width="100%" class="contentpaneopen">
			<tr>
				<td class="contentheading">
				<?php
		      HTML_joomleague::show_matchdays_title('', $round->id, $showPlan_config, 1);
				?>
				</td>
		  </tr>
		</table>
		<br />

		<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
		<?php
			$teamid = $team_plan;
			if ( $teamid > 0 ) {
			  $showPlan_config['show_dnp_teams'] = 0;
			}
			
			if ( count( $matches ) > 0 ) {
			  HTML_joomleague::show_matches( $matches, $teams, $showPlan_config );
			}
			else {
			 echo '<tr><td style="text-align:center;font-weight:bold;">'._JL_RESULTS_NO_MATCHES_THIS_MATCHDAY.'</td></tr>';
			}
			$whatday++;
		?>
		</table>

		<?php
		if ( $teamid == 0 || $whatday == count( $rounds ) && count( $matches ) > 0 ) 
		{ 
		  ?>
			<table width="100%" class="contentpaneopen">
				<tr>
					<td class="linktop" style="text-align:right">
					<?php
			  echo '<a href="'.str_replace('&', '&amp;', sefRelToAbs($_SERVER['REQUEST_URI'])).'#jl_top">'._JL_TOP.'</a>';
					?>
					</td>
			  </tr>
			</table>
			<!-- Main END -->
			<?php
		}
		else echo '<br />';
	}

?>

<!-- Print Button START -->
<?php if ($showPlan_config['show_back_button'] > 0 OR $overall_config['show_back_button'] > 0) {;?>
<?php if ($showPlan_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params = new mosParameters( '' );
$params->def( 'back_button', true );
$params->def( 'popup', false );
mosHTML::BackButton( $params );
?></div> 
<?php };?>
<!-- Print Button END -->
